import Vue from 'vue';
import Router from 'vue-router';
import config from "../../config/index.js";
const home = resolve => require(['@/page/website/home'], resolve)
const product = resolve => require(['@/page/website/product'], resolve)
const productDetail = resolve => require(['@/page/website/productDetail'], resolve)
const register = resolve => require(['@/page/website/register'], resolve)
const login = resolve => require(['@/page/website/login'], resolve)
const forget = resolve => require(['@/page/website/forget'], resolve)

const orderHand = resolve => require(['@/page/system/orderProgram/orderHand'], resolve)
const channelOrderHand = resolve => require(['@/page/system/orderProgram/channelOrderHand'], resolve)
const bankBankOrderHand = resolve => require(['@/page/system/orderProgram/bankBankOrderHand'], resolve)
const bankBankOrderDetail = resolve => require(['@/page/system/orderProgram/bankBankOrderDetail'], resolve)
const channelBankOrderHand = resolve => require(['@/page/system/orderProgram/channelBankOrderHand'], resolve)
const channelRepaymentOrder = resolve => require(['@/page/system/orderProgram/channelRepaymentOrder'], resolve)
const channelBankOrderDetail = resolve => require(['@/page/system/orderProgram/channelBankOrderDetail'], resolve)
const bankOrderHand = resolve => require(['@/page/system/orderProgram/bankOrderHand'], resolve)
const bankOrderDetail = resolve => require(['@/page/system/orderProgram/bankOrderDetail'], resolve)
const channelOrderDetail = resolve => require(['@/page/system/orderProgram/channelOrderDetail'], resolve)
const companyEdit = resolve => require(['@/page/system/myCompany/companyEdit'], resolve)
const certificationList = resolve => require(['@/page/system/myCompany/certificationList'], resolve)
const repaymentOrder = resolve => require(['@/page/system/orderProgram/repaymentOrder'], resolve)
const orderDetail = resolve => require(['@/page/system/orderProgram/orderDetail'], resolve)
const equityList = resolve => require(['@/page/system/myCompany/equityList'], resolve)
const financialInfo = resolve => require(['@/page/system/myCompany/financialInfo'], resolve)
const financialInfoV2 = resolve => require(['@/page/system/myCompany/financialInfo_v2'], resolve)
const financialReportAnalysis = resolve => require(['@/page/system/myCompany/financialReportAnalysis'], resolve)
const financialProfit = resolve => require(['@/page/system/myCompany/financialProfit'], resolve)
const financialBalance = resolve => require(['@/page/system/myCompany/financialBalance'], resolve)
const financialCashflow = resolve => require(['@/page/system/myCompany/financialCashflow'], resolve)
const financialOther = resolve => require(['@/page/system/myCompany/financialOther'], resolve)
const financialBalanceEdit = resolve => require(['@/page/system/myCompany/financialBalanceEdit'], resolve)
const financialReportAnalysisEdit = resolve => require(['@/page/system/myCompany/financialReportAnalysisEdit'], resolve)
const financeOperatingEdit = resolve => require(['@/page/system/myCompany/financeOperatingEdit'], resolve)
const financeInfoEdit = resolve => require(['@/page/system/myCompany/financeInfoEdit'], resolve)
const aboutUs = resolve => require(['@/page/website/aboutUs'], resolve)
const businessPlan = resolve => require(['@/page/system/myCompany/businessPlan'], resolve)
const questionList = resolve => require(['@/page/system/myCompany/questionList'], resolve)
const changePassword = resolve => require(['@/page/website/changePassword'], resolve)
const companyList = resolve => require(['@/page/system/myCompany/companyList'], resolve)
const companyDetail = resolve => require(['@/page/system/myCompany/companyDetail'], resolve)
const companyChannelDetail = resolve => require(['@/page/system/myCompany/companyChannelEdit'], resolve)
const userLoan = resolve => require(['@/page/system/myCompany/userLoan'], resolve)
const stockList = resolve => require(['@/page/system/myCompany/stockList'], resolve)
const branches = resolve => require(['@/page/system/myCompany/branches'], resolve)
const companyBankDetail = resolve => require(['@/page/system/myCompany/companyBankDetail'], resolve)
const changeAccount = resolve => require(['@/page/system/myCompany/changeAccount'], resolve)
const homeOne = resolve => require(['@/page/website/homeOne'], resolve)

Vue.use(Router)

export default new Router({
    mode: 'history',
    base: config.webType == 'test' ? '/web/' : '',
    routes: [{
            path: '/',
            name: 'home',
            component: home
        },
        {
            path: '/homeOne',
            name: 'homeOne',
            component: homeOne
        },
        {
            path: '/product',
            name: 'product',
            component: product
        },
        {
            path: '/productDetail',
            name: 'productDetail',
            component: productDetail
        },
        {
            path: '/login',
            name: 'login',
            component: login
        },
        {
            path: '/forget',
            name: 'forget',
            component: forget
        },
        {
            path: '/register',
            name: 'register',
            component: register
        },
        {
            path: '/bankOrderHand',
            name: 'bankOrderHand',
            component: bankOrderHand
        },
        {
            path: '/bankOrderDetail/:id',
            name: 'bankOrderDetail',
            component: bankOrderDetail
        },
        {
            path: '/ccOrderHand',
            name: 'ccOrderHand',
            component: orderHand
        },
        {
            path: '/channelOrderHand',
            name: 'channelOrderHand',
            component: channelOrderHand
        },
        {
            path: '/channelOrderDetail/:id',
            name: 'channelOrderDetail',
            component: channelOrderDetail
        },
        {
            path: '/channelBankOrderHand',
            name: 'channelBankOrderHand',
            component: channelBankOrderHand
        },
        {
            path: '/channelBankOrderDetail/:id',
            name: 'channelBankOrderDetail',
            component: channelBankOrderDetail
        },
        {
            path: '/bankBankOrderHand',
            name: 'bankBankOrderHand',
            component: bankBankOrderHand
        },
        {
            path: '/channelRepaymentOrder',
            name: 'channelRepaymentOrder',
            component: channelRepaymentOrder
        },
        {
            path: '/bankBankOrderDetail/:id',
            name: 'bankBankOrderDetail',
            component: bankBankOrderDetail
        },
        {
            path: '/ccOrderDetail/:id',
            name: 'ccOrderDetail',
            component: orderDetail
        },
        {
            path: '/companyEdit',
            name: 'companyEdit',
            component: companyEdit
        },
        {
            path: '/certificationList',
            name: 'certificationList',
            component: certificationList
        },
        {
            path: '/repaymentOrder',
            name: 'repaymentOrder',
            component: repaymentOrder
        },
        {
            path: '/orderDetail/:id',
            name: 'orderDetail',
            component: orderDetail
        },
        {
            path: '/equityList',
            name: 'equityList',
            component: equityList
        },
        {
            path: '/financialInfo',
            name: 'financialInfo',
            component: financialInfo
        },
        {
            path: '/financialInfo_v2',
            name: 'financialInfo_v2',
            component: financialInfoV2,
            children: [{
                    path: '/financialInfo_v2/financialReportAnalysis',
                    name: 'financialReportAnalysis',
                    component: financialReportAnalysis
                }, {
                    path: '/financialInfo_v2/financialBalance',
                    name: 'financialBalance',
                    component: financialBalance
                }, {
                    path: '/financialInfo_v2/financialProfit',
                    name: 'financialProfit',
                    component: financialProfit
                }, {
                    path: '/financialInfo_v2/financialCashflow',
                    name: 'financialCashflow',
                    component: financialCashflow
                },
                {
                    path: '/financialInfo_v2/financialOther',
                    name: 'financialOther',
                    component: financialOther
                }
            ]
        }, {
            path: '/financialInfo_v2/financialBalanceEdit',
            name: 'financialBalanceEdit',
            component: financialBalanceEdit
        }, {
            path: '/financialInfo_v2/financialReportAnalysisEdit',
            name: 'financialReportAnalysisEdit',
            component: financialReportAnalysisEdit
        }, {
            path: '/financialInfo_v2/financeOperatingEdit',
            name: 'financeOperatingEdit',
            component: financeOperatingEdit
        }, {
            path: '/financialInfo_v2/financeInfoEdit',
            name: 'financeInfoEdit',
            component: financeInfoEdit
        },
        {
            path: '/aboutUs',
            name: 'aboutUs',
            component: aboutUs
        },
        {
            path: '/businessPlan',
            name: 'businessPlan',
            component: businessPlan
        },
        {
            path: '/questionList',
            name: 'questionList',
            component: questionList
        },
        {
            path: '/changePassword',
            name: 'changePassword',
            component: changePassword
        },
        {
            path: '/companyList',
            name: 'companyList',
            component: companyList
        },
        {
            path: '/companyDetail',
            name: 'companyDetail',
            component: companyDetail
        },
        {
            path: '/companyChannelDetail',
            name: 'companyChannelDetail',
            component: companyChannelDetail
        },
        {
            path: '/userLoan',
            name: 'userLoan',
            component: userLoan
        },
        {
            path: '/stockList',
            name: 'stockList',
            component: stockList
        },
        {
            path: '/branches',
            name: 'branches',
            component: branches
        },
        {
            path: '/companyBankDetail',
            name: 'companyBankDetail',
            component: companyBankDetail
        },
        {
            path: '/changeAccount',
            name: 'changeAccount',
            component: changeAccount
        }
    ]
})